import toolAction from "@/tool/http/tool-action";

let actionAccountMenu = toolAction.init("account_menu");

let dictAccountMenu = [];

const rule = {
  queryParams: [],
  metadata: [
    { name: "pid", dictListFun: () => dictAccountMenu },
    {
      name: "is_core",
      dictList: [
        { name: "是", val: "1" },
        { name: "否", val: "0" },
      ],
    },
  ],
};

export default async function () {
  dictAccountMenu = [
    {
      name: "根节点",
      val: 0,
      children: await actionAccountMenu.dict(),
    },
  ];
  return rule;
}
